<?php
/**
 * Nweb Framework
 *
 * This script is protected by copyright. It's use, copying, modification
 * and distribution without written consent of the author is prohibited.
 *
 * @category    source
 * @package     pl.nweb.framework.exception
 * @author      Krzysztof Kardasz <krzysztof.kardasz@gmail.com>
 * @copyright   Copyright (c) 2011 Krzysztof Kardasz
 * @license     http://www.gnu.org/licenses/lgpl-3.0.txt  GNU Lesser General Public
 * @version     3.0 $Id: exception.php 475 2012-08-24 20:49:56Z krzysztof.kardasz $
 * @link        http://code.google.com/p/nweb-framework/
 * @link        http://framework.nweb.pl
 */

namespace pl\nweb\framework;

/**
 * Wyjątek frameworka
 *
 * @category    source
 * @package     pl.nweb.framework.exception
 * @author      Krzysztof Kardasz <krzysztof.kardasz@gmail.com>
 * @copyright   Copyright (c) 2011 Krzysztof Kardasz
 * @version     3.0 $Id: exception.php 475 2012-08-24 20:49:56Z krzysztof.kardasz $
 */
class Exception extends \Exception
{
    /**
     * Konstruktor
     *
     * @param string $msg wiadomość
     * @param int $code kod błędu
     * @param array $params parametry
     * @param Exception $previous poprzedni wyjątek
     * @return void
     */
    public function __construct($msg = '', $code = 0, array $params = array(), Exception $previous = null)
    {
        if (count($params)) {
            $msg = vsprintf($msg, $params);
        }
        parent::__construct($msg, $code, $previous);
    }
}